package com.qili.service.jc.impl;

import com.qili.base.mapper.BaseMapper;
import com.qili.base.service.impl.BaseServiceImpl;
import com.qili.entity.jc.JcPayRecord;
import com.qili.entity.jc.dto.JcPayRecordDTO;
import com.qili.entity.jc.dto.JcProjectDTO;
import com.qili.mapper.jc.JcPayRecordMapper;
import com.qili.service.jc.JcPayRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zhaoyongke
 * @date 2020/12/29
 * @description  工程款支付记录
 */
@Service
public class JcPayRecordServiceImpl extends BaseServiceImpl<JcPayRecord,String> implements JcPayRecordService {

    @Autowired
    private JcPayRecordMapper jcPayRecordMapper;
    @Override
    public BaseMapper<JcPayRecord, String> getMappser() {
        return jcPayRecordMapper;
    }
    @Override
    public List<JcPayRecordDTO> selectPayRecord(JcProjectDTO dto){
        return    jcPayRecordMapper.selectPayRecord(dto);
    }
    @Override
    public   List<JcPayRecordDTO> selectPayRecordDe(JcProjectDTO dto){
        return    jcPayRecordMapper.selectPayRecordDe(dto);
    }

    @Override
    public List<JcPayRecordDTO> selectHk(JcProjectDTO dto) {
        return jcPayRecordMapper.selectHk(dto);
    }

    @Override
    public JcPayRecordDTO selectHkById(String id) {
        return jcPayRecordMapper.selectHkById(id);
    }

    @Override
    public List<JcPayRecordDTO> queryPayModeBy(String projectId,String type) {
        if("监理".equals(type)){
            return jcPayRecordMapper.queryPayModeByJl(projectId);
        }else if("咨询".equals(type)){
            return jcPayRecordMapper.queryPayModeByZx(projectId);
        }else{
            return jcPayRecordMapper.queryPayModeByJc(projectId);
        }
    }
}
